package com.pony.iphone.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.pony.iphone.dto.QuestionAnswerDto;
import com.pony.iphone.dto.QuestionAnswerErrorDto;
import com.pony.iphone.entity.Question;
import com.pony.iphone.utils.R;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;

/**
 * @author pony
 * @create 2025-09-17 14:31
 */
public interface QuestionService extends IService<Question> {
    // 上传问题和答案
    R upload(QuestionAnswerDto questionAnswerDto);

    // 获取一个问题的答案
    R getAnswer(QuestionAnswerDto qaDto);

    /**
     * 获得一个问题的答案
     * @param questionAnswerErrorDtoList 一个问题和所有答案选项
     * @return R
     */
    @Transactional
    R uploadError(ArrayList<QuestionAnswerErrorDto> questionAnswerErrorDtoList);
}
